import org.imraniqbal.engine.*;
import org.imraniqbal.mouseland.*;

import junit.framework.TestCase;

public class TrapTest extends TestCase {
	MouselandGame game;
	Map map;
	
	Trap test1;
	public TrapTest(String name) {
		super(name);
	}

	protected void setUp() throws Exception {
		super.setUp();
		map = new Map(30,30);
		test1 = new Trap(5,5);
		game = new MouselandGame();
	}

	//MAPPABLE TESTS
	public void testGetSetX() {
		assertEquals(5,test1.getX()); //set to 5 originally
		test1.setX(2);
		assertEquals(2,test1.getX());
	}
	public void testGetSetY() {
		assertEquals(5,test1.getY()); //set to 5 originally
		test1.setY(2);
		assertEquals(2,test1.getY());
	}
	
	//ITEM TESTS: None
	
	//TRAP TESTS
	
	public void testAction() {
		map.addMappable(test1);
		assertEquals(true,map.getMappable(5,5).contains(test1));
		Mouse tempMouse = new Mouse(5,5,2);
		map.addMappable(tempMouse);
		
		test1.action(tempMouse, map);
		assertEquals(false, map.getMappable(5,5).contains(test1));
	}
	
	
	
}
